import java.util.ArrayList;
import java.util.Iterator;

public class ModeErr {
	public ArrayList<Integer> Modes; 
	public Iterator<Integer> curr_err; 
	
	ModeErr() {
		Modes = new ArrayList<Integer>(Baxterpump.Mode.Modes);
		curr_err  = Modes.iterator();
	}
	
	public int next_err(int md) {
		while(curr_err.hasNext()) {
			int m = curr_err.next();
			if(m != md) {
				return m; 
			}
		}
		return -1;
	}
	
	public void reset() {
		curr_err  = Modes.iterator();
	}		
}
	
